/**
 * 是否贴地处理函数
 * 当前值，当前分块属性数据对象，标绘对象，总属性对象
 */
export const ground = (val: any, arry: any, graphic: any, property: any) => {
    console.log(property);
    /**
     * 图上文字 文字--ordinaryText  立面文字--specialText   贴地旋转文字--specialText   跑马文字--specialText
     * 图上标点 图标点--iconPoint
     * 图上线段 线段--segment 曲线--segment 管道--pipeline  走廊--corridor  围栏--fence 道路--road
     * 二维平面 平面--plane 矩形--rectangle 多边形--polygon  正多边形--regular  圆形--circle 扇形--sector 椭圆--ellipse
     * 三维立体 立体--box 圆柱--column 椭圆柱--ellipticCylinder  圆锥--cylinder  球及椭球--ellipsoid 雷达及半球--ellipsoid
     */
    const graphicType = graphic.options.plottingType;
    if (
        graphicType == "corridor" ||
        graphicType == "circle" ||
        graphicType == "sector" ||
        graphicType == "regular" ||
        graphicType == "ellipse" ||
        graphicType == "rectangle" ||
        graphicType == "polygon" ||
        graphicType == "column" ||
        graphicType == "ellipticCylinder"
    ) {
        property.forEach((p: any) => {
            p.children.forEach((c: any) => {
                if (c.datas.includes("fill") || c.datas.includes("height") || c.datas.includes("diffHeight")) {
                    setTimeout(() => {
                        if (val) {
                            c.isShow = false;
                            if (!c.datas.includes("fill")) {
                                c.value = 0;
                            }
                        } else {
                            c.isShow = true;
                        }
                    }, 100);
                }
            });
        });
    }
};
